<?php

use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateKdPaperExamQuestionTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('kd_paper_exam_question', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('paper_exam_id')->comment('考试记录ID');
            $table->integer('question_id')->comment('题目id');
            $table->string('question_answer', 2000)->nullable()->comment('题目及作答快照');
            $table->tinyInteger('status')->default(2)->comment('1正确，2错误');
            $table->tinyInteger('get_score')->default(0)->comment('得到的分数');
            $table->timestamps();
        });
        DB::statement("ALTER TABLE kd_paper_exam_question COMMENT='考试题目记录表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('kd_paper_exam_question');
    }
}
